package com.xuan.factory.method;

    /**
 * 工厂方法模式
 * @工厂： PhoneFactory ComputerFactory
 * @产品： Phone Computer
 * @抽象工厂：   DeviceFactory
 * @抽象产品：   Device
 * @despriction: 每一个产品都有自己的工厂
 */
public class MethodFactoryDemo {
    public static void main(String[] args) {
        PhoneFactory phoneFactory = new PhoneFactory();
        ComputerFactory computerFactory = new ComputerFactory();

        Device phone = phoneFactory.createDevice();
        Device computer = computerFactory.createDevice();

        phone.produce();
        computer.produce();
    }
}
